package com.javen.service;

import java.util.List;
import java.util.concurrent.CountDownLatch;

import com.zimmur.common.SpringBeanFactory;
import com.zimmur.service.base.UserBrowserHistoryService;
import com.zimmur.solr.model.Goods;

public class UserBrowerQueryTask implements Runnable {
	private CountDownLatch begin;
	private CountDownLatch end;
	private int id;

	public UserBrowerQueryTask(int i, CountDownLatch begin,CountDownLatch end) {
		super();
		this.id = i;
		this.begin = begin;
		this.end = end;
	}
	
	@Override
	public void run() {
		try {
			begin.await();
			UserBrowserHistoryService bean = SpringBeanFactory.getBean(UserBrowserHistoryService.class);
			String goodsId="1717258449446912";
			 List<Goods> list = bean.queryHistoryByUserId(id+"", 16);
			 for(Goods item:list){
				 System.out.println(id+"->"+item.toString());
			 }
		} catch (Exception e) {
			e.printStackTrace();
		}
		finally{
			end.countDown();
		}
	}

}
